home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0264.ZIP / ADVBAS.DOC < prev    next >
Text File  |  1985-10-28  |  21KB  |  1,057 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                            ADVBAS.LIB v1.4, 07/29/85
  8.  
  9.              Advanced Function Library for the IBM BASIC Compiler
  10.  
  11.                      Copyright (C) Thomas Hanlin III, 1985
  12.  
  13.  
  14.  
  15.  
  16. Requirements:
  17.      IBM  PC  or  close compatible, with the IBM BASIC Compiler.  Some of these
  18. routines  may  be  useful  for  the Microsoft version as well, but they haven't
  19. been tested for such use.
  20.  
  21.      The  IBM  BASIC  Compiler  is  a  powerful and flexible tool.  However, it
  22. suffers  from  a  number  of serious limitations, as it was designed for MS-DOS
  23. v1,  and  cannot  handle  version  2+  functions such as subdirectories; it has
  24. little  direct  access  to  many advanced DOS features such as selective screen
  25. scrolling;  and  is  sometimes  annoyingly  slow,  for all its improvement over
  26. interpreted  BASIC.   For  these  reasons,  I have designed a number of machine
  27. language  routines which perform desirable functions, and put them in a library
  28. which  the  compiler  can  access.   Since  I  have found these functions to be
  29. useful,  I  thought I'd pass them on to other people.  You may use ADVBAS func-
  30. tions  in  any  of your programs.  If you do so, I would appreciate you sending
  31. a  contribution  (recommended  amount $25, which will get you a disk containing
  32. the  source code to these routines, an explanation of how BASIC tokenizes prog-
  33. rams,  a  crossreference utility, a communications program [Eterm] with source,
  34. and  lots  more).   It  would  also  be  nice  if you acknowledged use of these
  35. routines  in  your  program.   ADVBAS  may  be copied and distributed freely as
  36. long  as  this  manual  is included unchanged.  The copyright is to preserve my
  37. options,  and  to  protect  you  from the untoward modifications of others.  It
  38. is not intended to prevent the free distribution of ADVBAS.
  39.  
  40.      Functions provided by ADVBAS: clear to end of screen line; scroll selected
  41. portion  of  screen  up  or  down, or clear it; backspace destructively; return
  42. free  drive  space;  get or set default drive; get or set default subdirectory;
  43. make  or delete a subdirectory; get MS-DOS (PC-DOS) version; translate a string
  44. to  uppercase  or  lowercase;  remove all occurrences of a given character from
  45. a string; wait for one of a list of keys to be pressed, returning the key
  46. value; Xmodem/Ymodem checksum and CRC (cyclical redundancy check) calculation;
  47. saving  and restoring the contents of the screen; translating a character using
  48. a  string  table;  passing a string though AND, OR, and XOR functions; printing
  49. to  the screen with great speed, or using MS-DOS functions which allow ANSI.SYS
  50. to function; getting a file's time/date stamp; and more! 
  51.  
  52.      To  use  ADVBAS  functions,  you must copy ADVBAS.LIB to the disk on which
  53. you  keep  your BASIC Compiler library files.  When you compile a program which
  54. uses  an  ADVBAS function, you must specify ADVBAS (preceeded by a drive letter
  55. if  it's  on a different disk than the program you're compiling) when LINK asks
  56. you which libraries to use.  That is, at the LINKer's prompt "Libraries [.LIB]:-
  57. " you should say "ADVBAS" (without the quotes!).
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.      These  functions  have  not  caused  me any problems, and seem to be fully
  74. debugged;  however,  I  will  not be responsible for any damages caused by use,
  75. misuse,  or  inability to use ADVBAS.  But I'll try my best to fix any problems
  76. you  may  turn  up!  Keep in mind that ADVBAS functions will work only with the
  77. compiler,  not  the  interpreter,  and was tested on IBM BASIC Compiler version
  78. 1.00.
  79.  
  80.      Aside from their convenience, these functions have some additional value:
  81. they allow abilities which are not otherwise available from Compiled BASIC;
  82. they  are  generally  faster  than  the corresponding Compiled BASIC code would
  83. be,  often  greatly  so;  they  usually  take  up  less  space in the resulting
  84. EXEcutable file; and they often leave you more free programming space.
  85.  
  86.      Please  mail  contributions,  suggestions  for additional functions, ques-
  87. tions, comments, etc. to the following address:
  88.  
  89.                                Thomas Hanlin III
  90.                              6812 Sydenstricker Rd
  91.                              Springfield, VA 22152
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. Function Requirements:
  140.  
  141.      Numeric variables used in function calls must be integers.  Either declare
  142. them  using  DEFINT, or add a percent sign "%" to the end of the variable name.
  143. Strings  sometimes  must be defined to a certain minimum length, due to limita-
  144. tions  on  what machine language routines are allowed to do to strings.  Follow
  145. the  guidelines  for  each  routine  in these respects, or the program will not
  146. work as expected!
  147.  
  148.  
  149.  
  150.  
  151. Function Descriptions, the meat of the matter:
  152.  
  153.  
  154.  
  155. Name: CLREOL
  156.  
  157. Type: Video
  158.  
  159. Description:
  160.      Clear  from  cursor  position  to  end  of line.  Doesn't move the cursor.
  161. No arguments.
  162.  
  163. Example:
  164.      CALL CLREOL
  165.  
  166.  
  167.  
  168.  
  169. Name: BKSPACE
  170.  
  171. Type: Video
  172.  
  173. Description:
  174.      Move  cursor  back  one space, destroying the character on the space moved
  175. to.   Will  wrap  from one line to the next higher if necessary.  If at the top
  176. left  corner  of  the screen, no action is performed.  Two arguments return the
  177. new  cursor  X,Y  coordinates,  since machine language programs cannot directly
  178. change the BASIC cursor position.
  179.  
  180. Example:
  181.      CALL BKSPACE(X,Y) : LOCATE Y,X
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. Name: SCROLL
  206.  
  207. Type: Video
  208.  
  209. Description:
  210.      Scrolls any selected portion of the screen as many times as you like
  211. (1-255,  or  use  0 to clear that part of the screen entirely).  Five arguments
  212. give  coordinates  (x1,y1) of the upper left corner of the area to be scrolled,
  213. coordinates  (x2,y2)  of  the  lower  right  corner of the area to be scrolled,
  214. and the number of times to scroll the area.  This routine may be used to create
  215. windows.   Note  that  X2  must be at least one greater than X1 (no single-line
  216. scrolling,  obviously).   Parameters  are not checked, so be careful not to use
  217. illegal screen coordinates.
  218.  
  219. Example:
  220.      CALL SCROLL(X1,Y1,X2,Y2,LINS)
  221.  
  222.  
  223.  
  224.  
  225. Name: BKSCROLL
  226.  
  227. Type: Video
  228.  
  229. Description:
  230.      The  same  as  SCROLL  (q.v.), but scrolls lines in the opposite direction
  231. (Back Scroll).
  232.  
  233. Example:
  234.      CALL BKSCROLL(X1,Y1,X2,Y2,LINS)
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. Name: QPRINT
  272.  
  273. Type: Video
  274.  
  275. Description:
  276.      This  function  bypasses  the  usual  video  routines, and prints a string
  277. directly  on  the screen, at a -much- higher speed than the normal PRINT state-
  278. ment  does.   It  also contains a built-in LOCATE statement, and doesn't affect
  279. the  cursor  position.   The string may be any length.  Control characters will
  280. show  up  as  graphics  characters  instead of having their original functions,
  281. and  the  color/attributes  used  will be the ones already on the screen.  This
  282. works  for  40  or  80 column displays, monochrome or color.  Display page zero
  283. will be used (if applicable).
  284.      Note:  this  function  appeared  in BYTE magazine in a different form, and
  285. has  been  modified  several  times  since.  It is not solely my creation.  See
  286. the source code for further information.
  287.  
  288. Example:
  289.      ST$ = "This is a test of fast screen printing"
  290.      ROW = 10 : COLUMN = 20
  291.      CALL QPRINT(ST$,ROW,COLUMN)
  292.  
  293.  
  294.  
  295.  
  296. Name: XQPRINT
  297.  
  298. Type: Video
  299.  
  300. Description:
  301.      This  function  is  an  extended  version of QPRINT.  It is more flexible,
  302. and  only  a  trifle slower.  XQPRINT has two advantages over QPRINT: it allows
  303. you  to  choose  a  color/attribute  to use, and lets you choose a display page
  304. (color/graphics  adapters  only!).   The  attribute  ATTR  must be set up using
  305. a  special  formula,  and  the display page is limited to a range of 0-3.  This
  306. means  that  in  40-column  mode,  the display page used will actually be twice
  307. the  argument  you  give  the  function, giving you access to 40-column display
  308. pages  0,2,4,  and  6.   Or  so  the theory goes.  The page argument is ignored
  309. for monochrome adapters.
  310.  
  311. Example:
  312.      ST$ = "This is a test of fast screen printing"
  313.      ROW = 10 : COLUMN = 20 : PAGE = 0
  314.      ATTR = (BACKGROUNDCOLOR AND 7) * 16 + FOREGROUNDCOLOR
  315.      CALL XQPRINT(ST$,ROW,COLUMN,ATTR,PAGE)
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. Name: MPRINTC
  338.  
  339. Type: Video
  340.  
  341. Description:
  342.      Using  this  function,  you  can  at  last  access  device drivers such as
  343. ANSI.SYS.   This  is a video output function which goes through MS-DOS function
  344. calls.    Advantage: allows   use   of  ANSI.SYS  and  similar  video  drivers.
  345. Disadvantages: is slower and takes more memory that the usual PRINT statement.
  346.      Summary: prints a single character out to the display.
  347.  
  348. Example:
  349.      CH$ = "" : WHILE CH$<>"!" : CH$ = INPUT$(1) : CALL MPRINTC(CH$) : WEND
  350.  
  351.  
  352.  
  353.  
  354. Name: XMPRINT
  355.  
  356. Type: Video
  357.  
  358. Description:
  359.      This  routine  combines the XLATE and MPRINTC functions.  It takes a char-
  360. acter,  runs it through a translation table, and prints it to the screen unless
  361. the  translated  value  is  NUL  (ASCII  zero).  If it's NUL, no printing takes
  362. place.   MS-DOS  calls  are  used for printing, so ANSI.SYS will work.  See the
  363. XLATE and MPRINTC routines for further information.
  364.  
  365. Example:
  366.      CALL XMPRINT(CH$,XLATE$)
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403. Name: SCRSAVE
  404.  
  405. Type: Video
  406.  
  407. Description:
  408.      Stores  the  current screen display (page 0 only) in an array.  Text modes
  409. only.   Requires  an  array  of  8000 bytes, and an integer which points to the
  410. location of the array.  The cursor position is not saved.
  411.  
  412. Example:
  413.      DEFINT A-Z : OPTION BASE 1 : DIM SCR(4000)
  414.       .
  415.       .
  416.      WHER = VARPTR(SCR(1)) : CALL SCRSAVE(WHER)
  417.      CX = POS(0) : CY = CSRLIN
  418.      REM  Dim of 4000 w/ option base 1 gives us 4000 integers, each of
  419.      REM  which occupy two bytes, giving 8000 bytes of storage space.
  420.  
  421.  
  422.  
  423.  
  424. Name: SCRREST
  425.  
  426. Type: Video
  427.  
  428. Description:
  429.      Restores  the  screen  display from an image put into an array by SCRSAVE.
  430. Same requirements and limitations of SCRSAVE.
  431.  
  432. Example:
  433.      WHER = VARPTR(SCR(1)) : CALL SCRREST(WHER) : LOCATE CY,CX
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469. Name: GETDOSV
  470.  
  471. Type: Miscellaneous
  472.  
  473. Description:
  474.      Gets  MS-DOS  version.   The  major version is returned in the first para-
  475. meter,  the  minor  version  in  the  second (e.g., MS-DOS v. 2.11 would return
  476. MAJ = 2, MIN = 11).
  477.  
  478. Example:
  479.      CALL GETDOSV(MAJ,MIN)
  480.  
  481.  
  482.  
  483.  
  484. Name: CHECKSUM
  485.  
  486. Type: Miscellaneous
  487.  
  488. Description:
  489.      Calculates  a checksum for a record of any length.  To be used with Xmodem
  490. or Ymodem.
  491.  
  492. Example:
  493.      CALL CHECKSUM(REC$,CHKSM)
  494.  
  495.  
  496.  
  497.  
  498. Name: CRC
  499.  
  500. Type: Miscellaneous
  501.  
  502. Description:
  503.      Calculates  a  cyclical  redundancy  check for a record of any length.  To
  504. be used with Xmodem/Ymodem CRC.
  505.  
  506. Example:
  507.   Sending a record:
  508.      REC$=REC$+STRING$(2,0) : CALL CRC(REC$,HICRC,LOCRC) :
  509.      MID$(REC$,129,2) = CHR$(HICRC)+CHR$(LOCRC) : send Xmodem record
  510.   Receiving a record:
  511.      CALL CRC(REC$,HICRC,LOCRC) : IF HICRC=0 AND LOCRC=0
  512.           THEN record is fine, save it
  513.           ELSE record is bad, request it to be sent again
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535. Name: GETKEY
  536.  
  537. Type: Keyboard
  538.  
  539. Description:
  540.      Waits  until  one  of  a list of keys is pressed, and returns it.  The key
  541. list  (any  length)  should  be uppercase, and if the length is null, the first
  542. key  pressed  will  be  returned.   The  key returned will be capitalized.  The
  543. variable  to return the key in must be at least one character long.  This func-
  544. tion is designed for returning one of a menu of choices, for example.
  545.  
  546. Example:
  547.      GOODKEYS$="KEY LIST"
  548.              .
  549.              .
  550.      KY$="x":CALL GETKEY(GOODKEYS$,KY$)
  551.  
  552.  
  553.  
  554.  
  555. Name: UPCASE
  556.  
  557. Type: String
  558.  
  559. Description:
  560.      Converts  a  string  to  all  uppercase.  Leaves non-alphabetic characters
  561. untouched.  String may be any length.
  562.  
  563. Example:
  564.      MSG$="Four score and seven years ago"
  565.                .
  566.                .
  567.      CALL UPCASE(MSG$)
  568.  
  569.  
  570.  
  571.  
  572. Name: LOCASE
  573.  
  574. Type: String
  575.  
  576. Description:
  577.      Converts  a  string  to  all  lowercase.  Leaves non-alphabetic characters
  578. untouched.  String may be any length.
  579.  
  580. Example:
  581.      MSG$="THis IS a test OF tHe lowercase CONVERTER!"
  582.                .
  583.                .
  584.      CALL LOCASE(MSG$)
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601. Name: STRIP
  602.  
  603. Type: String
  604.  
  605. Description:
  606.      Strips  all  occurrences  of  a given target character from a given source
  607. string.   The  source  string  may  be any length; the target string must be at
  608. least  one  character.   The  new  length of the source string will be returned
  609. as an integer, since external routines may not change the length of BASIC
  610. strings directly.
  611.  
  612. Example:
  613.      MSG$="12 - 2 =   10"
  614.           .
  615.           .
  616.      CH$=" " : CALL STRIP(MSG$,CH$,LN) : MSG$ = LEFT$(MSG$,LN)
  617.  
  618.  
  619.  
  620.  
  621. Name: XLATE
  622.  
  623. Type: String
  624.  
  625. Description:
  626.      This  function translates a character using a table you supply.  The char-
  627. acter's  ASCII  value  is used as the index to the table, and the value at that
  628. location  replaces  the  character's  current  value.  The character may be one
  629. byte  in  length,  in which case it will be translated, or zero bytes, in which
  630. case nothing will happen.  The translation string must be 256 bytes long (remem-
  631. ber, strings may be longer than 255 bytes in Compiled BASIC, so this is ok).
  632.  
  633. Example:
  634.     XLT$ = "" : FOR X=0 TO 255: XLT$=XLT$+CHR$(X): NEXT
  635.     MID$(XLT$,1,5) = "ABCDE": CH$ = CHR$(0)
  636.     CALL XLATE$(CH$,XLT$): PRINT CH$
  637.     REM  CH$ ends up "A", since the start of the table + zero bytes
  638.     REM      contains "A".  We add zero bytes, because CH$ was
  639.     REM      originally equal to CHR$(0).
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667. Name: MULTIAND
  668.  
  669. Type: String
  670.  
  671. Description:
  672.      This  is  a  flexible  function  with many possible uses.  Every character
  673. in  a  given  string  is  ANDed  with a value you supply.  One thing this could
  674. be  used  for is translating Wordstar files to ASCII files, by using a bit mask
  675. (the  value  that  will  be ANDed with the character) of &H7F, which strips off
  676. the  high  bit  of  each character.  The string may be any length; the bit mask
  677. is an integer, with only the low byte in use (value of 0-255).
  678.  
  679. Example:
  680.      ST$ = "" : FOR X=65 TO 70: ST$ = CHR$(X)+CHR$(X+128): NEXT : PRINT ST$
  681.      BITMASK = &H7F : CALL MULTIAND(ST$,BITMASK) : PRINT ST$
  682.  
  683.  
  684.  
  685.  
  686. Name: MULTIOR
  687.  
  688. Type: String
  689.  
  690. Description:
  691.      Does  the  exact  opposite  of  MULTIAND--  instead of stripping off bits,
  692. it  turns  on  bits.   This  is not quite as useful a function, but is included
  693. in  case  you  need  it.  The parameters are the same as for MULTIAND.  Instead
  694. of an AND function, this one uses an OR function on each character.
  695.  
  696. Example:
  697.      ST$ = "ABCDE": PRINT ST$: SETBITS = &H80
  698.      CALL MULTIOR(ST$,SETBITS): PRINT ST$
  699.  
  700.  
  701.  
  702.  
  703. Name: MULTIXOR
  704.  
  705. Type: String
  706.  
  707. Description:
  708.      An  exclusive-or  operation  for  strings.  Bits in the string will be set
  709. only  if they are set in the string byte or mask byte, but not in both of them.
  710. See your BASIC manual about functions AND, OR, XOR if you have any questions.
  711. Note  that  this  can  be used as a "MULTINOT" function by using a mask of &HFF
  712. or  255.   In  this  case,  all  bits are set in the mask, so the result of the
  713. XOR will be the same as a NOT operation on the string.
  714.  
  715. Example:
  716.      CALL MULTIXOR(ST$,MASK)
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733. Name: DRVSPACE
  734.  
  735. Type: Disk
  736.  
  737. Description:
  738.      Returns  the  amount  of free space left on a given disk drive.  The drive
  739. string  may  be  any  legal disk drive, or "@" (AT sign) for the default drive,
  740. and  must  be  at  least  one  character long.  An illegal drive or other error
  741. will cause free space to be returned as a negative value.
  742.  
  743. Example:
  744.      DRV$="A:"
  745.           .
  746.           .
  747.      CALL DRVSPACE(A$,B,C,D) : FREE = CSNG(B)*CSNG(C)*CSNG(D) :
  748.      PRINT"Free space on drive ";A$;" is";FREE;"bytes."
  749.  
  750.  
  751.  
  752.  
  753. Name: GETDRV
  754.  
  755. Type: Disk
  756.  
  757. Description:
  758.      Returns  the  letter  of  the  default drive.  The drive string must be at
  759. least one character long.
  760.  
  761. Example:
  762.      DRV$="x:" : CALL GETDRV(DRV$)
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799. Name: SETDRV
  800.  
  801. Type: Disk
  802.  
  803. Description:
  804.      Sets  the  default drive.  The drive string must be at least one character
  805. long, and an uppercase letter representing a disk drive.
  806.  
  807. Example:
  808.      DRV$="B:"
  809.           .
  810.           .
  811.      CALL SETDRV(DRV$)
  812.  
  813.  
  814.  
  815.  
  816. Name: GETSUB
  817.  
  818. Type: Disk
  819.  
  820. Description:
  821.      Gets the default subdirectory.  The subdirectory string must be 64 charac-
  822. ters  long,  and  it  is  recommended  that you set it to ASCII zeroes (the NUL
  823. character).  The length of the subdirectory string is returned as an integer
  824. value.  Note that the string will NOT be started by a backslash "\" character--
  825. you should add one if appropriate.
  826.  
  827. Example:
  828.      SUB$ = STRING$(64,0) : CALL GETSUB(SUB$,LN) :
  829.      SUB$ = "\" + LEFT$(SUB$,LN)
  830.  
  831.  
  832.  
  833.  
  834. Name: SETSUB
  835.  
  836. Type: Disk
  837.  
  838. Description:
  839.      Sets  the  default subdirectory.  The subdirectory string must be at least
  840. one  character  in  length,  since  it  must  be terminated by a NUL character.
  841. A  negative  one  will  be returned if there was a problem setting to the given
  842. subdirectory  (either  it's  not available on the default drive, or a bad name,
  843. most likely); else zero will be returned if all went well.
  844.  
  845. Example:
  846.      TMP$ = SUB$+CHR$(0) : CALL SETSUB(TMP$,ERRCODE) :
  847.      IF ERRCODE THEN bad subdir ELSE new default subdir selected
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865. Name: MAKESUB
  866.  
  867. Type: Disk
  868.  
  869. Description:
  870.      Makes a subdirectory.  Parameters used are the same as in SETSUB.
  871.  
  872. Example:
  873.      TMP$ = SUB$+CHR$(0) : CALL MAKESUB(TMP$,ERRCODE) :
  874.      IF ERRCODE THEN couldn't make subdir ELSE subdir created
  875.  
  876.  
  877.  
  878.  
  879. Name: DELSUB
  880.  
  881. Type: Disk
  882.  
  883. Description:
  884.      Deletes  a  subdirectory.   Parameters  used  are  the  same as in SETSUB.
  885. Note  that  you  may  not delete a subdirectory if it has any files left in it,
  886. or if it is the main directory, or if it is the current default subdirectory.
  887.  
  888. Example:
  889.      TMP$ = SUB$+CHR$(0) : CALL DELSUB(TMP$,ERRCODE) :
  890.      IF ERRCODE THEN couldn't delete subdir ELSE subdir deleted
  891.  
  892.  
  893.  
  894.  
  895. Name: GETFDATE
  896.  
  897. Type: Disk
  898.  
  899. Description:
  900.      GETFDATE  returns  the  file  creation  date, that is, the date you see on
  901. a  file  when  you  get  a DIRectory.  The file name must be terminated with an
  902. ASCII  NUL  character.  If there is an error, such as there being no such file,
  903. the month will be -1.
  904.  
  905. Example:
  906.      FIL$ = "TESTFILE.TXT" + CHR$(0)
  907.      CALL GETFDATE(FIL$,MONTH,DAY,YEAR)
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931. Name: GETFTIME
  932.  
  933. Type: Disk
  934.  
  935. Description:
  936.      This  function  complements  GETFDATE, and returns the file creation time.
  937. The  hour  is in 24-hour (military) format, and will be returned as -1 if there
  938. is  no such file or a bad file name.  The seconds are rounded to the next lower
  939. even  number,  due to the DOS storage format.  The file name must be terminated
  940. with an ASCII zero, or NUL character.
  941.  
  942. Example:
  943.      FIL$ = "ANYFILE.EXT" + CHR$(0)
  944.      CALL GETFTIME(FIL$,HOUR,MINUTE,SECOND)
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.                                   Bascom Bugs
  998.                           (info unrelated to ADVBAS!)
  999.  
  1000.  
  1001.  
  1002.  
  1003.      Following  are  a  few  notes  on  BASIC Compiler bugs that I've run into.
  1004. These  are  not  caused  by  the ADVBAS routines, and have no relation to them.
  1005. I  just  thought  it might be helpful if I mentioned them, since anyone reading
  1006. this evidently has, or is considering buying, the IBM BASIC Compiler.
  1007.  
  1008.      Illegal  file  names  return  a  "Bad  file number" error, rather than the
  1009. expected "Bad file name".
  1010.  
  1011.      The  control  codes  to  move the cursor left and right work fine, but not
  1012. the ones to move it up and down, which do nothing.
  1013.  
  1014.      Register  BP  is not saved by the compiler when it does a CALL.  This must
  1015. be  done  by  the  called  program, since this register is used by the compiler
  1016. for vital information.
  1017.  
  1018.      The  /E compiler option seems to introduce errors into some programs which
  1019. crash  them  by freezing the computer or giving a "String Space Corrupt" error.
  1020. If  this  happens,  I've found you can fix it by adding the /D option, or using
  1021. /X  instead  of  /E.   The latter method cuts down heavily on available program
  1022. space,  so  it  may  not  be as good as the former.  Both add a fair bit to the
  1023. EXE  program  size.   It's a hard life...  This problem may also cause programs
  1024. compiled  without  the  /O  option to lock up, which can't be fixed by using /X
  1025. or /D.  Use the /O option if this happens.
  1026.  
  1027.      If  you  find  any other bugs in the BASIC Compiler, or in ADVBAS for that
  1028. matter,  please  tell  me  about  it.   ADVBAS I can fix, and I can warn people
  1029. about compiler problems!
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.